<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<div id="app">
    <login name=lwj age="23"></login>
</div>


<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    //定义一个局部组件

    let login={
        template:"<div><h1>欢迎你{{name}}  年龄{{age}}</h1></div>",
        //用来接受组件传递的参数
        props: ['name','age']
    }


    var app=new Vue(
        {
            el:"#app",
            data:{},
            methods:{},
            //注册组件
            components:{
                login:login//注册局部组件
            }
        }
    )
</script>
</body>
</html>